package View;

import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.Font;
import java.io.Serializable;

/** this class provide the GUI in order to produce report at any kind that system needs **/
public class ReportsView extends JFrame  implements Serializable {

	private static final long serialVersionUID = 42L;
	/** requierd buttons **/
	JButton CommentBtn;
	JButton CustomerBtn;
	JButton BackBtn;
	
	/** default and only constructor **/
	public ReportsView() {
		setResizable(false);
		getContentPane().setLayout(null);
		
		this.setSize(404, 346);
	  
	    this.setTitle("Reports");
		 CommentBtn = new JButton("Comments Report");
		CommentBtn.setFont(new Font("Tahoma", Font.BOLD, 18));
		CommentBtn.setBounds(102, 33, 199, 99);
		getContentPane().add(CommentBtn);
		
		CustomerBtn = new JButton("Customers Report");
		CustomerBtn.setFont(new Font("Tahoma", Font.BOLD, 18));
		CustomerBtn.setBounds(102, 143, 199, 91);
		getContentPane().add(CustomerBtn);
		
	 BackBtn = new JButton("Back");
	 BackBtn.setFont(new Font("Tahoma", Font.BOLD, 16));
	 BackBtn.setBounds(144, 262, 113, 29);
		getContentPane().add(BackBtn);
		//this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setLocationRelativeTo(null); 
		
	}
	
	/** get buttons functions **/
      public JButton getCommentBtn()
      {
    	  return this.CommentBtn;
      }
      
      public JButton getCustomerBtn()
      {
    	  return this.CustomerBtn;
      }
      
      public JButton getBackBtn()
      {
    	  return this.BackBtn;
      }
      
      /** add action listeners to types of reports and to back buttons **/
	public void addReportsListeners(ActionListener actionListener){
		CommentBtn.addActionListener(actionListener);
		CustomerBtn.addActionListener(actionListener);
		BackBtn.addActionListener(actionListener);
		
	}
	
	/** show and hide window functions **/
	public void showWindow(){
		setVisible(true);
	}
	public void hideWindow(){
		setVisible(false);
	}
}